FROM ubuntu:14.04
MAINTAINER 39185753@qq.com
RUN sudo rm /etc/apt/sources.list
ADD docker-build/sources.list /etc/apt/sources.list
RUN sudo  apt-get update
RUN sudo apt-get install -y \
        python-dev \
        mysql-client libmysqlclient-dev
RUN sudo apt-get install -y \
        python-pip

RUN sudo apt-get install -y \
        supervisor
RUN sudo pip install mysqlclient
RUN sudo pip install django==1.10
RUN sudo apt-get install -y vim
RUN pip install django-qiniu-storage
RUN sudo apt-get install -y gettext
RUN sudo pip install uwsgi
RUN sudo apt-get install -y nginx
#RUN sudo apt-get install -y \
#        language-pack-zh-hant-base \
#        language-pack-zh-hans-base
#RUN sudo locale-gen
#RUN sudo apt-get install -y \
#        libssl-dev \
#        libffi-dev
RUN mkdir -p  /var/log/supervisor
RUN mkdir -p /var/www/qiyanbao
ADD src /var/www/qiyanbao
ADD docker-build/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ADD docker-build/nginx/default.conf /etc/nginx/sites-enabled/default
ADD docker-build/nginx/nginx.conf /etc/nginx/nginx.conf
WORKDIR /var/www/qiyanbao
EXPOSE 80
ENV LANG zh_CN.UTF-8
ENV LANGUAGE zh_CN:zh:en_US:en
ENV LC_ALL zh_CN.UTF-8
RUN django-admin makemessages
ENV TZ=Asia/shanghai
RUN sudo echo "Asia/shanghai" > /etc/timezone
RUN echo yes|python /var/www/qiyanbao/manage.py collectstatic
CMD ["/usr/bin/supervisord"]